<template>
    <div>
          <el-button type="primary" @click="add()">添加</el-button>
        <v-list @bianji='bianji'></v-list>
        <v-add :obj='obj' ref='aa'></v-add>
    </div>
</template>

<script>
import vAdd from './components/add.vue'
import vList from './components/list.vue'
export default {
    data(){
        return{
            obj:{
                istrue:false,
                isadd:true
            }
        }
    },
    components:{
        vAdd,
        vList
    },
    methods:{
        add(){
            this.obj.istrue=true
            this.obj.isadd=true
        },
        // 编辑
        bianji(id){
            this.obj.istrue=true
            this.obj.isadd=false
            // console.log(id);
            this.$refs.aa.getinfo(id)
        }
    }
}
</script>

<style lang="less">
    
</style>